<template>
  <div class="home-TUIKit-main">
    <div class="conversation">
      <TUISearch class="TUIKit-search" />
      <TUIConversation />
    </div>
    <div class="TUIKit-chat">
      <TUIChat/>
    </div>
  </div>

</template>

<script lang="ts" setup>
import { reactive, ref, Ref, getCurrentInstance, toRefs } from 'vue';
//资料上的写法
// import { TUIEnv } from '../../TUIKit/TUIPlugin';
import { TUILogin } from "@tencentcloud/tui-core";
import { TUISearch, TUIConversation, TUIChat, TUIContact, TUIGroup } from "../../TUIKit";
import { isPC } from '../../TUIKit/utils/env';
//初始化TUIKit环境
const data = reactive({
  env: isPC,
});

const { proxy } = getCurrentInstance();
proxy.$http("/front/customer/im/createAccount", "GET", null, true, function (resp) {
  let result = resp.result
  let account = result.account;
  let sdkAppId = result.sdkAppId
  let userSig = result.userSig
  //登陆客户IM账号
  TUILogin.login({
    SDKAppID: sdkAppId,
    userID: account,
    userSig: userSig,
  });
})
</script>


<style lang="less">
@import url("customer_im.less");
</style>

